package com.totoro.tymapping.listener;

import com.totoro.tymapping.TyMapping;
import com.totoro.tymapping.bo.CheckParseBo;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;

/**
 * @author Totoro
 * @version 0.1.0
 * @date 2025/8/13 - 14:29
 * @description
 **/
public class TyMappingListener implements Listener {

    private final TyMapping plugin;

    public TyMappingListener(TyMapping plugin) {
        this.plugin = plugin;
    }

    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        plugin.getCheckTaskManager().put(event.getPlayer().getUniqueId(), new CheckParseBo());
    }
    @EventHandler
    public void onQuit(PlayerQuitEvent event) {
        plugin.getCheckTaskManager().remove(event.getPlayer().getUniqueId());
    }
}
